<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/6/3
  Time: 0:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript">
        function findByPage(pageNum) {
            window.location.href="${pageContext.request.contextPath}/findPage.do?page="+pageNum;
        }
    </script>
</head>
<body>
<h2>分页用户查询</h2>
<hr>

<table>
    <tr>
        <td>序号</td>
        <td>id</td>
        <td>用户名</td>
        <td>密码</td>
    </tr>
    <c:forEach items="${pageInfo.list}" var="user" begin="0" varStatus="status">
    <tr>
        <td>${status.count}</td>
        <td>${user.id}</td>
        <td>${user.username}</td>
        <td>${user.pass}</td>
    </tr>
    </c:forEach>
</table>
    <hr>
    <c:set var="begin" value="${pageInfo.firstPage}"/>
    <c:set var="end" value="${pageInfo.lastPage}"/>
    <c:forEach var="num" begin="${begin}" end="${end}">
    <a href="javascript:findByPage(${num})">${num}</a>
    </c:forEach>
</body>
</html>
